home *** CD-ROM | disk | FTP | other *** search
/ Scene Storm / Scene Storm - Volume 1.iso / coding / c / snoopdos_source / patches.h < prev    next >
Text File  |  1996-02-16  |  4KB  |  130 lines

  1. /*
  2.  *        PATCHES.H                                            vi:ts=4
  3.  *
  4.  *      Copyright (c) Eddy Carroll, September 1994.
  5.  *
  6.  *        Contains definitions used by the patches module
  7.  */
  8.  
  9. #define reg_d0    register __d0
  10. #define reg_d1    register __d1
  11. #define reg_d2    register __d2
  12. #define reg_d3    register __d3
  13. #define reg_d4    register __d4
  14. #define reg_d5    register __d5
  15. #define reg_d6    register __d6
  16. #define reg_d7    register __d7
  17. #define reg_a0    register __a0
  18. #define reg_a1    register __a1
  19. #define reg_a2    register __a2
  20. #define reg_a3    register __a3
  21. #define reg_a4    register __a4
  22. #define reg_a5    register __a5
  23. #define reg_a6    register __a6
  24.  
  25. typedef enum {
  26.     DOS_LIB,
  27.     EXEC_LIB,
  28.     INTUITION_LIB,
  29.     GRAPHICS_LIB,
  30.     ICON_LIB,
  31.     NUM_LIBS
  32. } LibNumbers;
  33.  
  34. /*
  35.  *        Now type definitions for all the functions to be replaced, so that we
  36.  *        can easily call the original function from our replacement function.
  37.  */
  38. #define DFT(f)    typedef __asm ULONG (*FP_##f)    /* Define Function Type  */
  39. #define LBASE    reg_a6 void *
  40. typedef struct TagItem *TAGPTR;
  41.  
  42. /*
  43.  *        Dos prototypes
  44.  */
  45. DFT(AddDosEntry)    (reg_d1 struct DosList *, LBASE);
  46. DFT(CurrentDir)        (reg_d1 BPTR,      LBASE);
  47. DFT(DeleteFile)        (reg_d1 char *,    LBASE);
  48. DFT(Execute)        (reg_d1 char *,    reg_d2 BPTR,     reg_d3 BPTR, LBASE);
  49. DFT(GetVar)            (reg_d1 char *,    reg_d2 char *,    reg_d3 ULONG, reg_d4 ULONG,
  50.                      LBASE);
  51. DFT(FindVar)        (reg_d1 char *,    reg_d2 ULONG,    LBASE);
  52. DFT(LoadSeg)        (reg_d1 char *,    LBASE);
  53. DFT(NewLoadSeg)        (reg_d1 char *,    reg_d2 TAGPTR,    LBASE);
  54. DFT(Lock)            (reg_d1 char *,    reg_d2 LONG,     LBASE);
  55. DFT(Open)            (reg_d1 char *,    reg_d2 ULONG,    LBASE);
  56. DFT(CreateDir)        (reg_d1 char *,    LBASE);
  57. DFT(MakeLink)        (reg_d1 char *,    reg_d2 LONG,     reg_d3 LONG, LBASE);
  58. DFT(Rename)            (reg_d1 char *,    reg_d2 char *,    LBASE);
  59. DFT(RunCommand)        (reg_d1 BPTR,    reg_d2 ULONG,    reg_d3 char *,
  60.                      reg_d4 ULONG,    LBASE);
  61. DFT(SetVar)            (reg_d1 char *,    reg_d2 char *,    reg_d3 ULONG, reg_d4 ULONG,
  62.                      LBASE);
  63. DFT(DeleteVar)        (reg_d1 char *,    reg_d2 ULONG,    LBASE);
  64. DFT(SystemTagList)    (reg_d1 char *,    reg_d2 TAGPTR,    LBASE);
  65.                 
  66. /*
  67.  *        Exec prototypes
  68.  */
  69. DFT(FindPort)        (reg_a1 char *,    LBASE);
  70. DFT(FindResident)    (reg_a1 char *, LBASE);
  71. DFT(FindResource)    (reg_a1 char *, LBASE);
  72. DFT(FindSemaphore)    (reg_a1 char *, LBASE);
  73. DFT(FindTask)        (reg_a1 char *, LBASE);
  74. DFT(OpenDevice)        (reg_a0 char *, reg_d0 long,    reg_a1 struct IORequest *,
  75.                      reg_d1 long,    LBASE);
  76. DFT(OpenLibrary)    (reg_a1 char *,    reg_d0 long,    LBASE);
  77. DFT(OpenResource)    (reg_a1 char *,    LBASE);
  78. DFT(GetMsg)            (reg_a0 struct MsgPort *,        LBASE);
  79. DFT(PutMsg)            (reg_a0 struct MsgPort *, reg_a1 struct Message *, LBASE);
  80.  
  81. /*
  82.  *        Graphics, Intuition and Icon library prototypes
  83.  */
  84. DFT(OpenFont)        (reg_a0 struct TextAttr *, LBASE);
  85. DFT(LockPubScreen)    (reg_a0 char *,  LBASE);
  86. DFT(FindToolType)    (reg_a0 char **, reg_a1 char *,    LBASE);
  87. DFT(MatchToolValue)    (reg_a0 char *,  reg_a1 char *, LBASE);
  88.  
  89. /*
  90.  *        Dos library function offsets
  91.  */
  92. #define LVO_AddDosEntry        -678
  93. #define LVO_CurrentDir        -126
  94. #define LVO_DeleteFile        -72
  95. #define LVO_Execute            -222
  96. #define LVO_GetVar            -906
  97. #define LVO_FindVar            -918
  98. #define LVO_LoadSeg            -150
  99. #define LVO_NewLoadSeg        -768
  100. #define LVO_Lock            -84
  101. #define LVO_Open            -30
  102. #define LVO_CreateDir        -120
  103. #define LVO_MakeLink        -444
  104. #define LVO_Rename            -78
  105. #define LVO_RunCommand        -504
  106. #define LVO_SetVar            -900
  107. #define LVO_DeleteVar        -912
  108. #define LVO_SystemTagList    -606
  109.  
  110. /*
  111.  *        Exec library function offsets
  112.  */
  113. #define LVO_FindPort        -390
  114. #define LVO_FindResident    -96
  115. #define LVO_FindSemaphore    -594
  116. #define LVO_FindTask        -294
  117. #define LVO_OpenDevice        -444
  118. #define LVO_OpenLibrary        -552
  119. #define LVO_OpenResource    -498
  120. #define LVO_GetMsg            -372
  121. #define LVO_PutMsg            -366
  122.  
  123. /*
  124.  *        Graphics, Intuition and Icon library function offsets
  125.  */
  126. #define LVO_OpenFont        -72
  127. #define LVO_LockPubScreen    -510
  128. #define LVO_FindToolType    -96
  129. #define LVO_MatchToolValue    -102
  130.